<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="commons/meta.jsp"%>
<%@ include file="commons/tags.jsp"%>
<title>视界评论管理</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}

.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}

.STYLE6 {
	color: #000000;
	font-size: 12;
}

.STYLE10 {
	color: #000000;
	font-size: 12px;
}

.STYLE19 {
	color: #344b50;
	font-size: 12px;
}

.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}

.STYLE22 {
	font-size: 12px;
	color: #295568;
}

-->
a:hover {
	background-color: white;
}

a:visited {
	color: #C71585;
	background-color: white;
}
</style>
<link rel="stylesheet"
	href="${ctx}/css/themes/jquery-ui-1.8.23.custom.css" />
<script src="${ctx}/js/jquery-1.8.0.min.js"></script>
<script src="${ctx}/js/jquery-ui-1.8.23.custom.min.js"></script>
<script src="${ctx}/js/jquery.ui.datepicker-zh-CN.js"></script>
<script>
	$(function() {
		$.datepicker.setDefaults($.datepicker.regional['zh-CN']);
		$("#fromDate").datepicker({
			changeMonth : true,
			changeYear : true,
			showButtonPanel : true,
			onSelect : function(selectedDate) {
				$("#toDate").datepicker("option", "minDate", selectedDate);
			}
		});
		$("#toDate").datepicker({
			changeMonth : true,
			changeYear : true,
			showButtonPanel : true,
			onSelect : function(selectedDate) {
				$("#fromDate").datepicker("option", "manDate", selectedDate);
			}
		});
		$("#chkall").click(function() {
			$('input[name="commentId"]').attr("checked", this.checked);
		});
		$("#first").click(function() {
			$("#pageNo").val(1);
			$("#pageForm").submit();
			return false;
		});
		$("#pre").click(function() {
			no = parseInt($("#pageNo").val()) - 1;
			$("#pageNo").val(no);
			$("#pageForm").submit();
			return false;
		});
		$("#next").click(function() {
			no = parseInt($("#pageNo").val()) + 1;
			$("#pageNo").val(no);
			$("#pageForm").submit();
			return false;
		});
		$("#last").click(function() {
			$("#pageNo").val($("#total").val());
			$("#pageForm").submit();
			return false;
		});
		$("#jump").click(function() {
			no = $.trim($("#jumpNo").val());
			if(no==""){
				alert("请输入正确的页码");
				return false;
			}
			total = parseInt($("#total").val());
			if (no < 1)
				no = 1;
			if (no > total)
				no = total;
			$("#pageNo").val(no);
			$("#pageForm").submit();
			return false;
		});
		$("#delselect").click(function() {
			var ids = $("input[name='commentId']:checked").length;
			if (ids > 0) {
				$("#pageForm").attr("action", "${ctx}/yueduComment/delete");
				$("#pageForm").submit();
			} else {
				alert("请选择要删除的内容");
			}
			return false;
		});
		$("#pass").click(function(){
			var ids = $("input[name='commentId']:checked").length;
			if (ids > 0) {
				$("#passVal").val(1);
				$("#pageForm").attr("action", "${ctx}/shijie_comment/audit");
				$("#pageForm").submit();
			} else {
				alert("请选择要审核的内容");
			}
			return false;
		});
		$("#unpass").click(function(){
			var ids = $("input[name='commentId']:checked").length;
			if (ids > 0) {
				$("#passVal").val(0)
				$("#pageForm").attr("action", "${ctx}/shijie_comment/audit");
				$("#pageForm").submit();
			} else {
				alert("请选择要审核的内容");
			}
			return false;
		});
	});
	
	function del(id){
		$('input[name="commentId"]').attr("checked", false);
		$("#delId").val(id);
		$("#pageForm").attr("action", "${ctx}/yueduComment/delete");
		$("#pageForm").submit();
		return false;
	}
	
	function audit(id,pass){
		$('input[name="commentId"]').attr("checked", false);
		$("#delId").val(id);
		$("#passVal").val(pass)
		$("#pageForm").attr("action", "${ctx}/yueduComment/audit");
		$("#pageForm").submit();
		return false;
	}
</script>
</head>

<body>
	<table width="100%" border="0" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<td><table cellspacing="2">
					<tr>
						<td><form action="${ctx }/yueduComment/queryPage"
								method="post">
								<input type="hidden" id="yueduId" name="yueduId"
									value="${yueduId}" /> <span class="STYLE10">评论内容：<input
									type="text" id="content" name="content" value="${content }" /></span><span
									class="STYLE10">发布时间 从：<input type="text" id="fromDate"
									name="startDate" readonly="true" value="" /> 至 <input
									type="text" id="toDate" name="endDate" readonly="true" value="" /></span><span
									style=""> <input type="submit" value="搜索" /></span>
							</form></td>
					</tr>
				</table></td>
		</tr>
	</table>
	<form id="pageForm" name="pageForm"
		action="${ctx }/yueduComment/queryPage" method="post">
		<input type="hidden" id="delId" name="commentId" />
		<table width="100%" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="30"><table width="100%" border="0" cellspacing="0"
						cellpadding="0">
						<tr>
							<td height="24" bgcolor="#353c44"><table width="100%"
									border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td><table width="100%" border="0" cellspacing="0"
												cellpadding="0">
												<tr>
													<td width="6%" height="19" valign="bottom"><div
															align="center">
															<img src="${ctx }/images/tb.gif" width="14" height="14" />
														</div></td>
													<td width="94%" valign="bottom"><span class="STYLE1">
															评论列表</span></td>
												</tr>
											</table></td>
										<td><div align="right">
												<input id="passVal" name="passVal" type="hidden" /> <span
													class="STYLE1"> <img src="${ctx }/images/add.gif"
													width="10" height="10" /> <a id="pass" href="">通过</a> | <a
													id="unpass" href="">未通过</a> &nbsp; <img
													src="${ctx }/images/del.gif" width="10" height="10" /> <a
													id="delselect" href="">删除</a> &nbsp;&nbsp;
												</span><span class="STYLE1"> &nbsp;</span>
											</div></td>
									</tr>
								</table></td>
						</tr>
					</table></td>
			</tr>
			<tr>
				<td><table width="100%" border="0" cellpadding="0"
						cellspacing="1" bgcolor="#a8c7ce">
						<tr>
							<td width="4%" height="20" bgcolor="d3eaef" class="STYLE10"><div
									align="center">
									<input type="checkbox" id="chkall" name="chkall" />
								</div></td>
							<td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">评论内容</span>
								</div></td>
							<td width="12%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">发布时间</span>
								</div></td>
							<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">发布者</span>
								</div></td>
							<td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">状态</span>
								</div></td>
							<td width="14%" height="20" bgcolor="d3eaef" class="STYLE6"><div
									align="center">
									<span class="STYLE10">基本操作</span>
								</div></td>
						</tr>
						<c:forEach var="comment" items="${info.dataArray}">
							<tr>
								<td height="20" bgcolor="#FFFFFF"><div align="center">
										<input type="checkbox" name="commentId" id="commentId"
											value="${comment.commentId }" />
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE6"><div
										align="center">
										<span class="STYLE19">${comment.content }</span>
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<fmt:formatDate value="${comment.publishdate}"
											pattern="yyyy-MM-dd" />
									</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">${comment.username}</div></td>
								<td height="20" bgcolor="#FFFFFF" class="STYLE19"><div
										align="center">
										<c:choose>
											<c:when test="${comment.state eq 0 }">未通过</c:when>
											<c:when test="${comment.state eq 1 }">通过</c:when>
										</c:choose>
									</div></td>
								<td height="20" bgcolor="#FFFFFF"><div align="center"
										class="STYLE21">
										<a href="#" onclick="del(${comment.commentId})">删除</a> |
										<c:choose>
											<c:when test="${comment.state eq 0 }">
												<a href="#" onclick="audit(${comment.commentId},1)">通过</a> | 未通过</c:when>
											<c:when test="${comment.state eq 1 }">通过 | <a
													href="#" onclick="audit(${comment.commentId},0)">未通过</a>
											</c:when>
										</c:choose>

									</div></td>
							</tr>
						</c:forEach>
					</table></td>
			</tr>
			<tr>
				<td height="30"><table width="100%" border="0" cellspacing="0"
						cellpadding="0">
						<tr>
							<td width="33%"><div align="left">
									<span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;共有<strong>
											${info.pageCount }</strong> 条记录，当前第<strong>${info.pageNum}</strong>
										页，共 <strong>${info.pageTotal }</strong> 页
									</span>
								</div></td>
							<td width="67%"><input type="hidden" id="pageNo"
								name="pageNo" value="${info.pageNum }" /><input type="hidden"
								id="yueduId" name="yueduId" value="${yueduId}" /><input
								type="hidden" id="content" name="content" value="${content }" /><input
								type="hidden" id="author" name="author" value="${author }" /> <input
								type="hidden" id="startDate" name="startDate"
								value="${startDate }" /> <input type="hidden" id="endDate"
								name="endDate" value="${endDate }" /> <input type="hidden"
								id="total" name="total" value="${info.pageTotal }" />
								<table width="312" border="0" align="right" cellpadding="0"
									cellspacing="0">
									<tr>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="first"
														test="${info.pageNum le 1 }">
														首页
											</c:if> <c:if test="${not first}">
														<a id="first" href="">首页</a>
													</c:if></span>
											</div></td>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="pre"
														test="${info.pageNum gt 1 }">
														<a id="pre" href="">上一页</a>
													</c:if> <c:if test="${not pre }">
												上一页
												</c:if>
												</span>
											</div></td>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="next"
														test="${info.pageNum lt info.pageTotal }">
														<a id="next" href="">下一页</a>
													</c:if> <c:if test="${not next }">
												下一页
												</c:if>
												</span>
											</div></td>
										<td width="49"><div align="center">
												<span class="STYLE22"> <c:if var="last"
														test="${info.pageNum ge info.pageTotal }">
														尾页
													</c:if> <c:if test="${not last }">
														<a id="last" href="">尾页</a>
													</c:if></span>
											</div></td>
										<td width="37" class="STYLE22"><div align="center">转到</div></td>
										<td width="22"><div align="center">
												<input type="text" name="jumpNo" id="jumpNo"
													onkeyup="value=value.replace(/[^\d]/g,'')"
													onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"
													style="width: 20px; height: 12px; font-size: 12px; border: solid 1px #7aaebd;" />
											</div></td>
										<td width="22" class="STYLE22"><div align="center">页</div></td>
										<td width="35"><span class="STYLE22"><a id="jump"
												href="">GO</a></a></span></td>
									</tr>
								</table></td>
						</tr>
					</table></td>
			</tr>
		</table>
	</form>
</body>
</html>
